<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	
	error_reporting (E_ALL ^ E_NOTICE);
	
	$debug = $_SESSION['debug'];
	
	/*
	* Class to select all existing requests
	*/
	class CommandSelectEmployees extends CustomCommand {
		/*
		 * Constructor of the class
		 */
		public function __construct() {
				
		}
		
		/*
		 * Method to execute to select all existing requests
		 */
		public function execute() {
			$daoFactory = DaoFactory :: getMySqlDaoFactory();
			$irad = $daoFactory -> getMySqlEmployeeAccessDao();			
			$sentence = $irad -> selectEmployees();
					$GLOBALS['debug']->log('Inicio funcion select employees ---comando');
			$employees = ''; $i = 0;
			while ($row = mysql_fetch_array($sentence)) {
				$employees['pk_id_number'][$i] = $row['pk_id_number'];
				$employees['first_name'][$i] = $row['first_name'];
				$employees['second_name'][$i] = $row['second_name'];
				$employees['first_last_name'][$i] = $row['first_last_name'];
				$employees['second_last_name'][$i] = $row['second_last_name'];
				$employees['email_address'][$i++] = $row['email_address'];
			}			
				$GLOBALS['debug']->log('Funcion  COMANDO EMPLEADO');
						$GLOBALS['debug']->log('fin funcion select employees');
			$this -> result = $employees;
		}
	}
?>